/********************************************************************************
 * Copyright (c) 2011-2017 Red Hat Inc. and/or its affiliates and others
 *
 * This program and the accompanying materials are made available under the 
 * terms of the Apache License, Version 2.0 which is available at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * SPDX-License-Identifier: Apache-2.0 
 ********************************************************************************/
package org.eclipse.ceylon.compiler.java.metadata;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation applied to a Java typed declaration (such as a method parameter 
 * or result) recording the Ceylon type of the declaration.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.METHOD})
public @interface TypeInfo {
    
    /** 
     * String representation of the Ceylon type that the annotated element has.
     * This needs to be in fully qualified form, as generated by the type printer.
     * Type abbreviations may be used.
     * @see org.eclipse.ceylon.model.typechecker.util.TypePrinter
     * @see org.eclipse.ceylon.model.loader.TypeParser
     */
    String value() default "";
    
    /**
     * Whether the declared method type was {@code void}
     */
    boolean declaredVoid() default false;
    
    /**
     * Whether the Ceylon type has been erased.
     */
    boolean erased() default false;
    
    /**
     * Set to true to get the same special handling as Java method return types wrt. null elements 
     */
    boolean uncheckedNull() default false;
    
    /**
     * Whether the declared type is untrusted.
     */
    boolean untrusted() default false;
}
